class MyCount: # 开始类的定义
    def __init__(self,num): # 类的构造
        self.num = num # 类的属性
    def cal_sum(self,num): # 类的方法
        my_sum = 0
        for i in range(0, self.num):
            my_sum += i
        return my_sum
count_1 = MyCount(100) # 将类 MyCount 实例化为对象 count_1
count_1.num = 101 # 对象的属性
print(count_1.cal_sum(100)) # 对象的方法
count_2 = MyCount(100)
print(count_2.cal_sum(100))
